import axios from 'axios';
import { req } from './axiosFun';

/**
 * dubbo 服务
 **/
// 分页查询dubbo 服务
export const GetDubboPage = (params) => { return req("post", "/api/innerServiceInvoke", params) };
// 请求调用
export const innerServiceInvoke = (params) => { return req("post", "/api/innerServiceInvoke", params) };

//api 管理
export const apiPageInfo = (params) => { return req("post", "/api/apiManage/getApiInfoPage", params) };

//组织管理G

export const addOrgInfo= (params) => { return req("post", "/api/service/org_add", params) };
export const deleteOrgInfo=(params)=>{return req("post", "/api/service/delete_org", params) }

//项目管理
export const getOrgByPage= (params) => { return req("post", "/api/service/get_org_project", params) };
export const getProjectByPage=(params)=>{return req("post", "/api/service/page_project_info", params) }
export const getProjectByOrg=(params)=>{return req("post", "/api/service/get_org_project", params) }

export const saveOrUpdateProject=(params)=>{return req("post", "/api/service/add_project", params) }
export const getTaskByPage=(params)=>{return req("post", "/api/service/get_task_page", params) }
export const addProjectTask=(params)=>{return req("post", "/api/service/add_project_task", params) }

// 查询文件列表
export const getFileList=(params)=>{return req("post", "/api/service/get_file_list", params) }
export const updateFileInfo=(params)=>{return req("post", "/api/service/update_file_info", params) }
export const getFieDownloadUrl=(params)=>{return req("get", "/file-service/file/getFileUrl?fileId="+params) }
export const deleteFile = (params) => {return req("post", "/api/service/delete_file", params)}




// 用户管理
export const getUserByPage= (params) => { return req("post", "/api/service/user_pageInfo", params) };
export const addUserInfo= (params) => { return req("post", "/api/service/user_adduserInfo", params) };
export const deleteUserInfo= (params) => { return req("post", "/api/service/delete_userInfo", params) };
export const getUserByAccount= (params) => { return req("post", "/api/service/get_user_by_account", params) };
export  const  getCurrentUserInfo= (params) => { return req("post", "/api/service/get_current_user_info", params) };

//角色
//添加角色
export const addRole= (params) => { return req("post", "/api/service/add_role", params) };
export const modRole= (params) => { return req("post", "/api/service/mod_role", params) };
export const getRoleList= (params) => { return req("post", "/api/service/get_role_list", params) };
export const delRole= (params) => { return req("post", "/api/service/del_role", params) };
//菜单
export const getAllMenu= (params) => { return  req("get", "/api/menuManage/getAllMenu") };
//添加&更新
export const addMenu= (params) => { return  req("post", "/api/menuManage/addOrUpdate",params) };
export const getRoleMenu= (params) => { return  req("post", "/api/menuManage/getRoleMenu?roleId="+params) };
export const addRoleMenu= (params) => { return  req("post", "/api/menuManage/roleBindMenu",params) };


//登录
export const AuthTwoLoginGetSign=(params) => { return req("post", "/api/service/userLogin_getSign", params) };

export const AuthTwoLoginGetAuth=(params) => { return req("post", "/api/service/userLogin_auth", params) };


export const apiAddOrUpdate = (params) => { return req("post", "/api/apiManage/addOrUpdateApi", params) };
// 商品管理-保存商品管理
export const GoodsSave = (params) => { return req("post", "/api/Goods/save", params) };
// 商品管理-删除商品管理
export const GoodsDelete = (params) => { return axios.delete("/api/Goods/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };

/**
 * 机器信息管理
 **/
// 机器信息管理-获取机器信息管理列表
export const MachineList = (params) => { return req("post", "/api/Machine/list", params) };
// 机器信息管理-保存机器信息管理
export const MachineSave = (params) => { return req("post", "/api/Machine/save", params) };
// 机器信息管理-删除机器信息管理
export const MachineDelete = (params) => { return axios.delete("/api/Machine/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };

/**
 * 货道信息管理
 **/
// 货道信息管理-获取获取货道信息管理列表
export const MachineAisleList = (params) => { return req("post", "/api/MachineAisle/list", params) };
// 货道信息管理-删除货道信息管理
export const MachineAisleDelete = (params) => { return axios.delete("/api/MachineAisle/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 货道信息管理-保存货道信息管理
export const MachineAisleRsave = (params) => { return req("post", "/api/MachineAisle/save", params) };
